Description

Welcome to CS101: Preview of Computer Science!

Computer science is not programming: programming is just one of several of the computer scientist's tools. The class will introduce you to a variety of computer science topics, taught both by the professor and by various faculty in the department and other guest lecturers.

General Information

Requirements to Take this Class
1. You must be a CS or Applied CS major. Likely majors may take the class with permission of the instructor.

2. All new CS or Applied CS majors must take this class at the same time as their first CS class (typically CS112, CS211, CS310, or CS367). We will teach CS101 in the Spring semester.

3. If your first CS class is not CS112, you may need to learn some basic Python. The professor will be glad to assist you in this.
Grading
Grading will be based on a combination of the following factors, each weighted approximately the same:

1. Class attendance and participation.

2. Participation in various sanctioned external activities and lectures related to computer science.

3. Seeing your academic advisor at some point during the semester.

4. A group project, with some possible warm-up exercises.

Announcements

Last Classes Attendance 
4/30/13 3:46 PM
Good job on presentations today.

Just in case you were wondering, even if you submitted all actives, presented your project and returned your robot you are not done with the class. You are still required to attend class and watch your fellow classmate presentations. If you do not show up for the next classes without proper excuse, you will fail the class.
Reminder: Activities due April 30th, 2013
4/23/13 8:41 PM
The activities are due next Tuesday in class (April 30th, 2013).
Make sure that you put all your activity evidences and advisor's checklist in a folder (together with the summaries of Thursday's lectures, if any).
There should be a total of 6 activities including the ones submitted before spring break.
Please don't forget to turn in the advisor checklist with the activities.
Announcement about the Final Project Presentations
4/23/13 6:51 PM
The final project presentations for CS101 will be done on the following days:
* April 30th, 2013.
* May 2nd, 2013.
* May 7th, 2013.

The order of presentations will be same as the proposal presentations:
1. R06
2. R08
3. R09
4. R10
5. R13
6. R14
7. R15
8. R17
9. R18
10. R19
11. R23
12. R24
13. R26
14. R28
15. R29
16. R04
17. R05
18. R11
19. R12
20. R16
21. R20
22. R21
23. R25
24. R27
25. R30
26. R31
27. R01
28. R02
29. R03
30. R07
31. R22

Note the following important points:

1. Total time of presentations will be 7 min for each group (including the question and answer session). It is advisable to finish your presentation in 5-6 min and give a minute or two for the questions to follow. If you are unable to wrap up your talk within the time limit, it will be left uncompleted.

2. The first slide should contain the project title, names of all group members and your group number (1, 2, 3....31).

3. If your presentation contains a video, upload it online (for example youtube) and run it through a link during your presentation.


4. The first 15 groups in the order of presentations should send their ppts to my email address (nvishnoi@cs.gmu.edu) by Monday night (April 29th, 2013). Failure in doing so may result in cancelling your presentation.
The rest of the group (in the order of presentations) should email their ppts by Wednesday night (May 1st, 2013).
Do not send the videos in the email. Upload them online and provide a link in your slides.
The subject of your email should read as "CS101 -Project Slides - [YourGroupNumber]".

5. Every group needs to fill up the attached form (FinalForm.pdf). You need to print out the form, fill it and submit a hard copy on the day of your presentation. Please make note if any groups members listed did not participate.

6. You may use the following as a guideline for your presentation:
  • What you proposed to do
  • What you actually did
  • How you did it
  • What you learned
7. Return your robot If you do not turn in your robot when you present your project, you will need to arrange to turn it in to one of the TAs as soon as possible.
Assignment #2
3/20/13 6:18 PM
Demo Deadline: April 4th, 2013 during the TA hours. You can demo it earlier if you have completed the assignment before the deadline.

Assignment:

Below are three options, each with a bonus section.
• Group A will implement one option without the bonus.
• Group B will implement one option with its bonus, OR two options without their bonus.
• Group C will implement two options AND at least ONE bonus, OR will implement all three options without their bonus.

Note: If you're in a mixed group, do the assignment which reflects the majority of your team (e.g. if your group has more As than Bs, do the A assignment).

Hint. All three of the options below are likely to be implemented with code in the following pattern:
Loop:
Get the sensors
Based on the sensors, decide how to move the robot
Move the robot a bit
Sleep a bit (maybe 50 or 100 ms)


1. BUMP AND RUN:

The Create has two bump sensors on its front. You will have the robot move forward until it senses a bump.

• If the left bump sensor was hit, the robot will turn 90 degrees to the right and continue forward.
• If the right bump sensor was hit, the robot will turn 90 degrees to the left and continue forward.
• If BOTH bump sensors were hit, the robot will turn 180 degrees and continue forward.

The robot will continue this behavior indefinitely. I suggest using a loop (with a small sleep in it) which queries the sensors and use turn() to rotate. Don't use move() to go forward; instead try go(), because move() turns off sensors while it's moving.
Bonus: The robot will also play some notes depending on what bump sensor got hit.

2. WALL FOLLOWING:

The Create has an infrared distance sensor on its right side, called the Wall sensor. Using the Wall sensor, have the robot move forward along a wall to its right while maintaining about the same distance from the wall. Suggestion for how to do this: make a big loop (with a small sleep in it) which queries the sensors and then changes the wheel motor values using the go() function. Each time in the loop you might check:
• If the wall is too far away, curve to the right a bit.
• If the wall is too close, curve a bit to the left.
• If the wall distances is within an acceptable range, go forward.

Ideally your robot should be able to handle outside corners as well using these rules. I suggest using only go(), not move() or turn().
Bonus: Inside Corners. What if the robot has to handle inside corners? As it's following the wall it hits the wall turning in front of it. Modify your code to handle inside turns as well as outside turns. To facilitate inside turns you might use turn() a bit in addition to go().

3. LINE FOLLOWING:

The Create has four "top hat" ("CLIFF") infrared sensors underneath, which point straight down and are used to detect whether the Create has reached a stair (a "cliff") or not. Here's how they work. The sensors beam some infrared light onto the floor. Then they detect how much light is reflected. If the floor is close, a lot of light is reflected. If the floor is far away, not much light is reflected. That's how they detect that he Create has come to a cliff -- the sensor is reporting very little light returning.
However, the sensors are also sensitive to material color. If their beam hits a light colored or highly reflective floor material, a lot of light will come back. If the beam hits a dark material, not much light will come back. In fact, the Roomba can be easily fooled by black carpets, thinking that they're actually stairs!
You can take advantage of this to have the Create follow a black line. Consider its middle-left and middle-right top hat sensors. Place the robot on the line so that the sensors are on opposite sides of the line. Then you might do a loop like this (again, with a little sleep):
• If the left sensor indicates that the black line is beneath it, curve a bit to the left.
• If the right sensor indicates that the black line is beneath it, curve a bit to the right.
• If NEITHER sensor indicates that the black line is beneath it, just go forward.
• If BOTH sensors indicate that the black line is beneath them, just go forward (this handles loops in the line)
The robot will continue this behavior indefinitely. Again, I suggest using only go(), not move() or turn().

PLEASE NOTE: To demo this, you need to bring your own line! A large sheet of white paper w/ black tape/marker is probably the best option.

Bonus: Calibrate.
Add a calibration routine: before starting along the line, place the robot on lines and on non-lines so it can determine what a line reading is and what a non-line reading is. From this, the robot should determine the point at which a sensor is assumed to be a line versus not a line (rather than using a hard-coded number).
Activities due Tuesday, April 30th
3/20/13 4:37 PM
As mentioned in the class yesterday, students who have not turned in 3 activities due before spring break, will have to write additional lecture summaries.
These summaries should be of lectures on Thursdays.

Students who have turned in 0 activity will submit 3 lecture summaries + 6 activities.
Students who have turned in 1 activity will submit 2 lecture summaries + 5 activities.
Students who have turned in 2 activities will submit 1 lecture summary + 4 activities.
Rest of them will submit the required number of activities to make a total of 6 activities for the whole semester.

In short, students will write (3-n) summaries and (6-n) activities, -1<n<3, where n is the number of activities turned in before the spring break! :)
Any Thursday lecture can be chosen for writing the summary but they can not be counted as an activity point.
Students who are unsure which group they belong to can send me an email.

Please note: The deadline to submit all the activities, summaries AND adviser check-list sheet is Tuesday, April 30th.
Order of Elevator Pitch Presentations
2/25/13 6:16 PM
The following is the order of Group numbers which will be followed tomorrow for elevator pitch presentation:

1. R06
2. R08
3. R09
4. R10
5. R13
6. R14
7. R15
8. R17
9. R18
10. R19
11. R23
12. R24
13. R26
14. R28
15. R29
16. R04
17. R05
18. R11
19. R12
20. R16
21. R20
22. R21
23. R25
24. R27
25. R30
26. R31
27. R01
28. R02
29. R03
30. R07
31. R22

Each group will get 3 minutes for their presentation.

Good Luck!
Nalini
1-page write up for Project Proposal & Elevator Pitch
2/25/13 5:00 PM
On Tuesday, Feb 26 all groups will have to turn in a 1-page write up (in hard copy during the class) about their Project proposals:

No less than one page 12pt times roman single-spaced. You need to propose what you are going to do, and argue:
  • Why do you think you can do it in time and with the resources you have and why you think your group has the chops to do it.
  • Why is it interesting.
  • What kinds of CS topics are involved in doing the project.
One paper per group. Turn in a hard copy in class. Make sure the paper includes the names of all group members and your group number.

Each group will get 3 minutes for their elevator pitch. Make sure to email your slides to Dr. Duric and/or to the TAs if you have not done it yet.
Assignment #1
2/12/13 4:01 PM
Demo Deadline: 2/26/13 for Groups 1-15 &amp; 2/28/13 for the remaining groups during the TA office hours only.

You must do the following two items:

1. Get the robot to move in a perfect 1-meter square and then stop.
2. Get the robot to move forward until it hits a wall, then stop.


Basically the goal here is to show that you understand how to fire up this robot and get it moving using the API provided. It is strongly recommended that all the group members (with laptops) make the robot work on their laptops. However, demo needs to be done on a single laptop.

Detailed instructions have been posted on Piazza regarding the steps to be followed in order to make the robot work on Mac/Linux and Windows.

There are additional bonus projects that you can work for fun on but they won't be getting you additional points:

• Show the robot wall-following with its sensor. This means that the robot moves along the wall and maintains a certain distance from a wall. Even better: what happens when the robot reaches inside or outside corners?
• Demonstrate a game of Pong with the robot as the puck.
• Demonstrate the robot tracing out more complex shapes: an S for example.

Important:
• You must demonstrate the behaviors to the TA or the UTA.
• You must not modify the code we provide -- write your own code in your own file which accesses it.
• If you want to demo your project earlier than the deadline, you can do that during the regular TA office hours or can set up an appointment by email to do so.
Staff Office Hours
NameOffice Hours
Zoran Duric
When?
Where?
Bryan Hoyle
When?
Where?

Lecture Notes